<?php $this->load->view('backend/include/modal_header')?>

<?php if ($selector == selector_replace('.project .center-content')):?>
	<?php if ($operate == 'create'):?>
	<script>
	$(function() {
		var width = <?php echo $selector_data['detail']['width']?>;
		var height = <?php echo $selector_data['detail']['height']?>;
		var readme = '（上传图片名称格式：项目名称-竣工年份）';
		My_widget.upload.upload_widget({ width: width, height: height, readme: readme });
	});
    </script>
	<div class="modal-body">
	</div>
	<?php elseif ($operate == 'edit'):?>
	<script>
	$(document).ready(function() {
		var width = <?php echo $selector_data['detail']['width']?>;
		var height = <?php echo $selector_data['detail']['height']?>;
		My_widget.sortable.sortable_widget({
			trash: true,
			inject_param: 'project_weight',
			type: 'image',
			width: width,
			height: height,
			resize_times: 2
		});
	});
    </script>
	<div class="modal-body">
		<div class="sortable-widget">
			<div class="sortable">
				<ul>
					<?php foreach ($project as $v):?>
					<li id="<?php echo $v['id']?>">
						<b><?php echo $v['name']?></b>
						<img src="<?php echo $v['thumb_pic']?>">
						<i class="icon-move"></i>
					</li>
					<?php endforeach;?>
				</ul>
			</div>
			<div class="trash">
			<i class="icon-trash"></i> <b>垃圾箱</b>
			</div>
		</div>
	</div>
	<?php endif;?>
<?php elseif ($selector == selector_replace('#project_carousel .viewport li')):?>
	<?php if ($operate == 'create'):?>
	<script>
	$(function() {
		var width = <?php echo $selector_data['detail']['width']?>;
		var height = <?php echo $selector_data['detail']['height']?>;
		//var readme = '（上传图片名称格式：项目名称-竣工年份）';
		My_widget.upload.upload_widget({ width: width, height: height/*, readme: readme*/ });
	});
    </script>
	<div class="modal-body">
	</div>
	<?php elseif ($operate == 'edit'):?>
	<script>
	$(document).ready(function() {
		var width = <?php echo $selector_data['detail']['width']?>;
		var height = <?php echo $selector_data['detail']['height']?>;
		My_widget.sortable.sortable_widget({
			trash: true,
			inject_param: 'project_pic_weight',
			type: 'image',
			width: width,
			height: height,
			resize_times: 4
		});
	});
    </script>
	<div class="modal-body">
		<div class="sortable-widget">
			<div class="sortable">
				<ul>
					<?php foreach ($project_pic as $v):?>
					<li id="<?php echo $v['id']?>">
						<img src="<?php echo $v['photo_path']?>">
						<i class="icon-move"></i>
					</li>
					<?php endforeach;?>
				</ul>
			</div>
			<div class="trash">
			<i class="icon-trash"></i> <b>垃圾箱</b>
			</div>
		</div>
	</div>
	<?php endif;?>
<?php endif;?>

<?php $this->load->view('backend/include/modal_footer')?>